#include"tcp_server.hpp"
#include<memory>

using namespace std;
using namespace ns_server;

static void usage(char*argv)
{
    cout<<"Usage\n\t"<<argv<<" serverPort"<<endl;
}

string echo(string message)
{
    return message;
}

int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port=atoi(argv[1]);

    unique_ptr<TcpServer> usvr(new TcpServer(echo,port));
    usvr->InitServer();
    usvr->Start();

    return 0;
}
